package com.cdie.myschool.controller;

import com.cdie.myschool.common.R;
import com.cdie.myschool.domain.dto.TeacherAwardsDTO;
import com.cdie.myschool.domain.entity.Awards;
import com.cdie.myschool.domain.vo.TeacherAwardsVO;
import com.cdie.myschool.service.TeacherAwardsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 雷金臣199000347
 * @date 2022/10/6 - 8:49
 */
@RestController
public class TeacherAwardsController {
    @Autowired
    private TeacherAwardsService teacherAwardsService;
    @RequestMapping("/awardsTest")
    public R<Awards> awardsTest(){
        R<Awards> r=teacherAwardsService.getAwards();
        if(r!=null){
            return R.Success("awards表插入成功！！！");
        }
        return R.Failed("awards表插入失败！！！");
    }
    @RequestMapping("/getAwardsInfo")
    public R<TeacherAwardsVO> getAwardsInfo(@RequestBody TeacherAwardsDTO teacherAwardsDTO){
        R<TeacherAwardsVO> r=teacherAwardsService.getAwardsInfo(teacherAwardsDTO);
        return R.Success("获奖信息查询成功！！！",r);
    }

}
